from django.urls import path
from apps.users.views import (UsernameCountView, RegisterView,
                              MobileCountView, LoginView, LogoutView,
                              CenterView, EmailView, EmailVerifyView,
                              AddressCreateView, AddressView, ChangeAddressView,
                              DefaultAddressView, ChangePasswordView,)

urlpatterns = [
    # 判断用户名是否重复的路由
    path('usernames/<username:username>/count/', UsernameCountView.as_view()),
    # 判断手机号是否重复的路由
    path('mobiles/<mobile:obile>/count/', MobileCountView.as_view()),
    # 注册页面的路由
    path('register/', RegisterView.as_view()),
    # 登录页面的路由
    path('login/', LoginView.as_view()),
    # 登出页面的路由
    path('logout/', LogoutView.as_view()),
    # 个人中心路由
    path('info/', CenterView.as_view()),
    # 发送邮件的路由
    path('emails/', EmailView.as_view()),
    # 验证激活邮件的路由
    path('email/verification/', EmailVerifyView.as_view()),
    # 新增地址的路由
    path('addresses/create/', AddressCreateView.as_view()),
    # 查询地址的路由
    path('addresses/', AddressView.as_view()),
    # 修改地址的路由 && 删除地址路由
    path('addresses/<id>/', ChangeAddressView.as_view()),
    # 设置默认地址的路由
    path('addresses/<id>/default/', DefaultAddressView.as_view()),
    # 修改密码的路由
    path('password/', ChangePasswordView.as_view()),
]
